######################################################################################################################################################

wget -q --no-check-certificate https://raw.githubusercontent.com/ciefp/CiefpIPTVBouquets/main/installer.sh -O - | /bin/sh

######################################################################################################################################################

..:: CiefpIPTVBouquets 1.4 ::..
CiefpIPTVBouquets je Enigma2 plugin dizajniran za upravljanje IPTV buketima na Enigma2 uređajima.
Omogućava korisnicima da preuzimaju, instaliraju, uređuju i brišu IPTV bukete direktno sa GitHub repozitorijuma, 
kao i da upravljaju kanalima unutar buketa. Plugin je koristan za korisnike koji žele lako organizovati IPTV sadržaj, 
uključujući kanale, serije i filmove, sa intuitivnim interfejsom.

Glavne funkcije:

Preuzimanje i instalacija IPTV buketa sa GitHub-a.
Uređivanje buketa (selektovanje, pomeranje, brisanje kanala).
Grupna selekcija sličnih kanala (npr. "HBO 1", "HBO 2", "HBO").
Upravljanje obrisanim buketima (.del fajlovi).
Reloudovanje postavki nakon promena.
Ekrani i njihovo korišćenje
Plugin ima jedan glavni ekran i četiri dodatna ekrana, svaki sa specifičnim funkcijama. 
Evo kratkog opisa i uputstva za korišćenje svakog:

1. ..:: CiefpIPTV ::.. (Glavni ekran)
Opis: Ovaj ekran omogućava preuzimanje i instalaciju IPTV buketa sa GitHub repozitorijuma.
Funkcije:
- Prikazuje listu dostupnih buketa sa GitHub-a (levo).
- Omogućava selekciju buketa za instalaciju (desno).
- Pokreće instalaciju selektovanih buketa i reloudovanje postavki.
- Pruža pristup drugim ekranima (IPTV Manager, BouquetViewer).
Korišćenje:
- OK/Zeleno: Selektuje/deselektuje buket sa leve liste i dodaje ga na desnu listu.
- Žuto: Pokreće instalaciju selektovanih buketa (potvrđuje se dijalogom).
- Crveno: Otvara ekran IPTV Manager.
- Plavo: Otvara ekran BouquetViewer.
- Cancel: Izlazi iz plugina.
- Gore/Dole: Navigacija kroz listu buketa.
Napomena: Buketi se preuzimaju sa GitHub-a, pa je potrebna internet konekcija.

2. ..:: BouquetViewer ::..
Opis: Omogućava pregled selektovanog buketa pre instalacije.
Funkcije:
- Prikaz sadržaja selektovanog buketa daje korisniku mogućnost da pregleda selektovani buket pre instalacije.

3. ..:: IPTV Manager ::..
Opis: Omogućava upravljanje instaliranim IPTV buketima, uključujući brisanje i uređivanje.
Funkcije:
- Prikazuje listu instaliranih IPTV buketa.
- Omogućava selekciju i brisanje buketa.
- Pruža pristup uređivanju buketa preko IPTV Editor ekrana.
Korišćenje:
- OK/Zeleno: Selektuje/deselektuje buket za brisanje.
- Crveno: Briše selektovane bukete (potvrđuje se dijalogom).
- Žuto: Otvara Bouquet Cleaner za brisanje .del fajlova iz etc/enigma2
- Plavo: Otvara IPTV Editor za uređivanje selektovanog buketa.
- Cancel: Vraća se na glavni ekran.
- Gore/Dole: Navigacija kroz listu buketa.
Napomena: Brisanje buketa uklanja ih iz sistema, a reloudovanje postavki je opciono nakon brisanja.

3. ..:: IPTV Editor ::..
Opis: Omogućava detaljno uređivanje kanala unutar odabranog buketa.
Funkcije:
- Prikazuje listu kanala u buketu.
- Podržava selekciju, grupnu selekciju sličnih kanala, pomeranje i brisanje kanala.
- Omogućava čuvanje promena i reloudovanje postavki.
Korišćenje:
- OK: Selektuje/deselektuje pojedinačni kanal.
- Crveno: Briše selektovane kanale (potvrđuje se dijalogom).
- Zeleno: Čuva promene u buketu (potvrđuje se dijalogom za reloudovanje).
- Žuto: Uključuje/isključuje "Move Mode" za pomeranje selektovanih kanala.
- Plavo: Pokreće grupnu selekciju sličnih kanala (npr. selektovanje "HBO 1" označava "HBO", "HBO 2", itd.).
- Gore/Dole: Navigacija kroz listu kanala; u "Move Mode", pomera selektovane kanale.
- Levo/Desno: Pomeranje po stranicama; u "Move Mode", pomera kanale za više pozicija.
- Cancel: Izlazi iz ekrana (upozorava ako postoje nesnimljene promene).
Napomena: Funkcija "Select Similar" je optimizovana za prepoznavanje sličnih kanala (npr. "HBO", "Cinemax", "Star Wars Episode"), 
uključujući poništavanje selekcije ako su svi slični kanali već označeni.

4. ..:: Bouquet Cleaner ::..
Opis: Upravlja obrisanim buketima (fajlovi sa ekstenzijom .del).
Funkcije:
- Prikazuje listu .del fajlova u /etc/enigma2/ direktorijumu.
- Omogućava selekciju i trajno brisanje .del fajlova.
Korišćenje:
- OK: Selektuje pojedinačni .del fajl.
- Zeleno: Selektuje sve .del fajlove.
- Crveno: Briše selektovane .del fajlove (potvrđuje se dijalogom).
- Cancel: Vraća se na glavni ekran.
- Gore/Dole: Navigacija kroz listu fajlova.
Napomena: Ovo je korisno za čišćenje starih ili nepotrebnih obrisanih buketa.

Kako koristiti plugin
Instalacija buketa:
Pokreni plugin i sačekaj da se učitaju buketi sa GitHub-a na glavnom ekranu.
Selektuj željene bukete (OK/Zeleno) i instaliraj ih (Žuto).
Potvrdi reloudovanje postavki ako je potrebno.

Prikaz buketa:
Prikaz sadržaja selektovanog buketa pre instalacije

Uređivanje buketa:
Iz glavnog ekrana, idi na IPTV Manager (Crveno).
Odaberi buket i otvori IPTV Editor (Plavo).
U IPTV Editor, selektuj kanale (OK), grupno selektuj slične kanale (Plavo), pomeri ih (Žuto + Gore/Dole), ili obriši (Crveno).
Sačuvaj promene (Zeleno) i potvrdi reloudovanje.

Brisanje buketa:
U IPTV Manager, selektuj bukete (OK/Zeleno) i obriši ih (Crveno).
Potvrdi reloudovanje postavki.

Čišćenje .del fajlova:
Iz glavnog ekrana, idi na Bouquet Cleaner (Plavo).
Selektuj .del fajlove (OK ili Zeleno za sve) i obriši ih (Crveno).

Zaključak
CiefpIPTVBouquets je moćan alat za upravljanje IPTV buketima, sa fokusom na jednostavnost i fleksibilnost. 
Glavni ekran služi za instalaciju, IPTV Manager za upravljanje buketima, 
IPTV Editor za detaljno uređivanje kanala, a Bouquet Cleaner za čišćenje obrisanih fajlova. 

..:: CiefpSettings ::..

####################################################################################################################################

..:: CiefpIPTVBouquets ::..
CiefpIPTVBouquets is an Enigma2 plugin designed to manage IPTV bouquets on Enigma2 devices.
It allows users to download, install, edit and delete IPTV bouquets directly from the GitHub repository,
as well as manage channels within the bouquet. The plugin is useful for users who want to easily organize IPTV content,
including channels, series and movies, with an intuitive interface.

Main functions:

Download and install IPTV bouquets from GitHub.
Bouquet editing (selecting, moving, deleting channels).
Group selection of similar channels (e.g. "HBO 1", "HBO 2", "HBO").
Management of deleted bouquets (.del files).
Reload settings after changes.
Screens and their use
The plugin has one main screen and four additional screens, each with specific functions.
Here is a brief description and instructions for using each:

1. ..:: CiefpIPTV ::.. (Main screen)
Description: This screen allows downloading and installing IPTV bouquets from the GitHub repository.
Functions:
- Displays a list of available bouquets from GitHub (left).
- Allows selecting a bouquet for installation (right).
- Starts installation of selected bouquets and reloading settings.
- Provides access to other screens (IPTV Manager, BouquetViewer).
Usage:
- OK/Green: Selects/deselects a bouquet from the left list and adds it to the right list.
- Yellow: Starts installation of selected bouquets (confirmed by a dialog).
- Red: Opens the IPTV Manager screen.
- Blue: Opens the BouquetViewer screen.
- Cancel: Exits the plugin.
- Up/Down: Navigates through the bouquet list.
Note: Bouquets are downloaded from GitHub, so an internet connection is required.

2. ..:: BouquetViewer ::..
Description: Allows preview of the selected bouquet before installation.
Functions:
- Displaying the contents of the selected bouquet gives the user the ability to preview the selected bouquet before installation.

3. ..:: IPTV Manager ::..
Description: Allows management of installed IPTV bouquets, including deleting and editing.
Functions:
- Displays a list of installed IPTV bouquets.
- Allows selection and deletion of bouquets.
- Provides access to editing bouquets via the IPTV Editor screen.
Usage:
- OK/Green: Selects/deselects a bouquet for deletion.
- Red: Deletes the selected bouquets (confirmed by a dialog).
- Yellow: Opens the Bouquet Cleaner to delete .del files from etc/enigma2
- Blue: Opens the IPTV Editor to edit the selected bouquet.
- Cancel: Returns to the main screen.
- Up/Down: Navigates through the bouquet list.
Note: Deleting bouquets removes them from the system, and reloading settings is optional after deletion.

3. ..:: IPTV Editor ::..
Description: Allows detailed editing of channels within the selected bouquet.
Functions:
- Displays the list of channels in the bouquet.
- Supports selection, group selection of similar channels, moving and deleting channels.
- Allows saving changes and reloading settings.
Usage:
- OK: Selects/deselects an individual channel.
- Red: Deletes selected channels (confirmed by a dialog).
- Green: Saves changes in the bouquet (confirmed by a reload dialog).
- Yellow: Enables/disables "Move Mode" for moving selected channels.
- Blue: Starts group selection of similar channels (e.g. selecting "HBO 1" means "HBO", "HBO 2", etc.).
- Up/Down: Navigates through the channel list; in "Move Mode", moves selected channels.
- Left/Right: Scrolls pages; in "Move Mode", moves channels by multiple positions.
- Cancel: Exits the screen (warns if there are unsaved changes).
Note: The "Select Similar" function is optimized for recognizing similar channels (e.g. "HBO", "Cinemax", "Star Wars Episode"),
including unselecting if all similar channels are already selected.

4. ..:: Bouquet Cleaner ::..
Description: Manages deleted bouquets (files with the extension .del).
Functions:
- Displays a list of .del files in the /etc/enigma2/ directory.
- Allows selection and permanent deletion of .del files.
Usage:
- OK: Selects a single .del file.
- Green: Selects all .del files.
- Red: Deletes the selected .del files (confirmed by a dialog).
- Cancel: Returns to the main screen.
- Up/Down: Navigates through the file list.
Note: This is useful for cleaning up old or unnecessary deleted bouquets.

How to use the plugin
Installing a bouquet:
Run the plugin and wait for the bouquets to load from GitHub on the main screen.
Select the desired bouquets (OK/Green) and install them (Yellow).
Confirm reloading the settings if necessary.

Viewing bouquets:
Viewing the contents of the selected bouquet before installation

Editing a bouquet:
From the main screen, go to the IPTV Manager (Red).
Select a bouquet and open the IPTV Editor (Blue).
In the IPTV Editor, select channels (OK), group select similar channels (Blue), move them (Yellow + Up/Down), or delete them (Red).
Save changes (Green) and confirm reloading.

Deleting a bouquet:
In the IPTV Manager, select bouquets (OK/Green) and delete them (Red).
Confirm reloading the settings.

Cleaning .del files:
From the main screen, go to Bouquet Cleaner (Blue).
Select .del files (OK or Green for all) and delete them (Red).

Conclusion
CiefpIPTVBouquets is a powerful tool for managing IPTV bouquets, with a focus on simplicity and flexibility.
The main screen is for installation, IPTV Manager for managing bouquets,
IPTV Editor for detailed channel editing, and Bouquet Cleaner for cleaning deleted files.

..:: CiefpSettings ::..